#ifndef __LINUX_IRQINTERNALS_H
#define __LINUX_IRQINTERNALS_H

#define _IRQ_DESC_CHECK		(1 << 0)
#define _IRQ_DESC_PERCPU	(1 << 1)

#define IRQ_GET_DESC_CHECK_GLOBAL	(_IRQ_DESC_CHECK)
#define IRQ_GET_DESC_CHECK_PERCPU	(_IRQ_DESC_CHECK | _IRQ_DESC_PERCPU)


enum
{
    IRQS_AUTODETECT = 0x00000001,
    IRQS_SPURIOUS_DISABLED = 0x00000002,
    IRQS_POLL_INPROGRESS = 0x00000008,
    IRQS_ONESHOT = 0x00000020,
    IRQS_REPLAY = 0x00000040,
    IRQS_WAITING = 0x00000080,
    IRQS_PENDING = 0x00000200,
    IRQS_SUSPENDED = 0x00000800,
};

enum
{
    IRQTF_RUNTHREAD,
    IRQTF_WARNED,
    IRQTF_AFFINITY,
    IRQTF_FORCED_THREAD,
};

static inline void irqd_set_move_pending(struct irq_data *d)
{
	d->state_use_accessors |= IRQD_SETAFFINITY_PENDING;
}

static inline void irqd_clr_move_pending(struct irq_data *d)
{
	d->state_use_accessors &= ~IRQD_SETAFFINITY_PENDING;
}

static inline void irqd_clear(struct irq_data *d, unsigned int mask)
{
	d->state_use_accessors &= ~mask;
}

static inline void irqd_set(struct irq_data *d, unsigned int mask)
{
	d->state_use_accessors |= mask;
}

static inline int irqd_has_set(struct irq_data *d, unsigned int mask)
{
	return d->state_use_accessors & mask;
}

#define for_each_action_of_desc(desc, act)			\
	for (act = desc->act; act; act = act->next)

irqreturn_t handle_irq_event(struct irq_desc *desc);

#endif
